﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;
using U8WebService.Common;

namespace U8WebService.BLL
{
    public class U8_Base
    {
        /// <summary>
        /// 验证用户是否合法登录
        /// </summary>
        /// <param name="sAccID">账套号</param>
        /// <param name="sYear">登录年度</param>
        /// <param name="sUserID">登录账号</param>
        /// <param name="sPassword">登录密码</param>
        /// <param name="sDate">登录日期</param>
        /// <param name="sServer">服务器地址</param>
        /// <returns></returns>
        public ReturnResult CheckLogin(string sAccID, string sYear, string sUserID, string sPassword, string sDate, string sServer)
        {
            ReturnResult rsl = new ReturnResult();
            U8Login.clsLogin u8Login = new U8Login.clsLogin();
            String sSubId = "AS";
            String sSerial = "";

            if (!u8Login.Login(ref sSubId, ref sAccID, ref sYear, ref sUserID, ref sPassword, ref sDate, ref sServer, ref sSerial))
            {
                rsl.Message = string.Format("失败原因：" + u8Login.ShareString);
                rsl.Result = false;
                return rsl;
            }
            else
            {
                rsl.Data = u8Login;
                rsl.Result = true;
                return rsl;
            }
        }
    }
}